package bitwiseOperation;

//https://leetcode.cn/problems/sum-of-two-integers/description/
public class l_371 {
    public int getSum(int a, int b) {
        while(b != 0)
        {
            int x = (a & b) << 1; //计算进位, 需要左移1
            a = a ^ b; //计算无进位相加结果
            b = x;
        }
        return a;
    }
}
